#ifndef EMPLOYEEDIALOG_H
#define EMPLOYEEDIALOG_H

#include <QDialog>
#include <QFormLayout>
#include <QLineEdit>
#include <QComboBox>
#include <QDateEdit>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QLabel>

class EmployeeDialog : public QDialog
{
    Q_OBJECT

public:
    explicit EmployeeDialog(QWidget *parent = nullptr);
    
    // 设置和获取员工信息
    void setEmployeeData(const QString &employeeId, const QString &name, 
                        const QString &team, const QString &hireDate, 
                        const QString &contact, const QString &status);
    
    QString getEmployeeId() const;
    QString getName() const;
    QString getTeam() const;
    QString getHireDate() const;
    QString getContact() const;
    QString getStatus() const;
    
    // 设置编辑模式（员工编号不可编辑）
    void setEditMode(bool editMode);

private slots:
    void validateInput();

private:
    void setupUI();
    void loadDepartmentData(); // 新增：加载班组数据
    
    QLineEdit *m_employeeIdEdit;
    QLineEdit *m_nameEdit;
    QComboBox *m_teamCombo;
    QDateEdit *m_hireDateEdit;
    QLineEdit *m_contactEdit;
    QComboBox *m_statusCombo;
    QDialogButtonBox *m_buttonBox;
    
    bool m_isEditMode;
};

#endif // EMPLOYEEDIALOG_H